package com.juitar.base;

import java.util.Iterator;
import java.util.List;

import com.juitar.base.fingering.FingeringBuilder;
import com.juitar.base.fingering.FingeringFilter;
import com.juitar.base.fingering.IFingeringFilter;
import com.juitar.base.utils.Config;

public class Stat {

	public static void main(String[] args) {
		List<Tuning> tunings = Config.getTunings();
		List<Chord> chords = Config.getChords();

		long t1 = System.currentTimeMillis();
		int count = 0;
		IFingeringFilter flt = new FingeringFilter(4, 0, 0, true);
		for (int note = 0; note < 12; note++) {
			for (Iterator<Tuning> itTuning = tunings.iterator(); itTuning.hasNext();) {
				Tuning tuning = itTuning.next();
				for (Iterator<Chord> itChord = chords.iterator(); itChord.hasNext();) {
					Chord chord = itChord.next();
					List<Fingering> fing = FingeringBuilder.create(chord, tuning, flt);
					//List fing = Fingering.find(chord, tuning, flt);
					count += fing.size();
				}
			}
		}
		long t2 = System.currentTimeMillis();
		System.out.println("Chords " + count);
		System.out.println("Time (msec) - " + (t2-t1));
	}

}
